<?php
namespace app\home\validate;

use think\Validate;

class CourseValidate extends Validate
{
    protected $rule = [
        'course_id' => 'require',
        'recipients' => 'require|chsDash',
        'mobile'  => 'require',
        'ck_mobile'  => 'require|confirm:mobile',
        'province' => 'require',
        //'city' => 'require|chsDash',
        //'district' => 'require|chsDash',
        'site' => 'require|chsDash',

        'sku_id' => 'require',
    ];
    protected $message = [
        'course_id.require' => '课程ID为空，非法操作',
        'recipients.require'  => '请输入收货人名称',
        'recipients.chsDash'  => '请输入正确的收货人名称【名字只能为：汉字、字母、数字和下划线】',
        
        'mobile.require'  => '请输入手机号',

        'ck_mobile.require'  => '请输入确认手机号',
        'ck_mobile.confirm'  => '两次号码不一致',

        'province.require'  => '请选择收货省份',
        'province.chsDash'  => '请输入正确的收货省份',


        //'city.require'  => '请选择收货市',
        //'city.chsDash'  => '请输入正确的收货市',

        //'district.require'  => '请选择收货区/县',
        //'district.chsDash'  => '请输入正确的收货区/县',

        'site.require'  => '请输入收货详细地址',
        'site.chsDash'  => '请输入正确的收货详细地址【只能输入：汉字、字母、数字和下划线】',

        'sku_id.require'  => '请选择要购买的课程规格',
       
    ];

    protected $scene = [
        //'city', 'district',
        'pay'  => ['course_id', 'recipients', 'mobile', 'province',  'site', 'sku_id'],
    ];
}